﻿<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Jdjf_ChooseCst.aspx.vb" Inherits="Slxt.Jdjf_ChooseCst"%>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<HTML>
	<HEAD>
		<title></title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE" />
		<meta content="JavaScript" name="vs_defaultClientScript" />
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
		<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css" />
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css" />
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css" />
		<link rel="stylesheet" type="text/css" href="/_controls/find/find.css" />
		<link rel="stylesheet" type="text/css" href="/_common/styles/global.css" />
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<script language="javascript" src="/_controls/settings.aspx"></script>
		<script language="javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" src="/_controls/datetime/date.js"></script>
		<script language="javascript" src="/_controls/number/number.js"></script>
		<script language="javascript" src="/Slxt/js/Public.js"></script>	
		
		<script language="javascript">
		    function window.onload() {
		        //判断用户是否有新增用户的权限
		        if (document.getElementById("txtNewUserPower").value == "0") {
		            document.getElementById("btnNewUser").disabled = true;
		        }

		        //动作点控制
		        var strIsHaveRight = GetDataFromXMLHTTP("/SLXT/XSXC/XSXC_XMLHTTP.aspx", "IsHaveSpRight", "01010209", "01");
		        if (strIsHaveRight != 1) {
		            document.getElementById("btnNewUser").disabled = true;
		        }

		        var strIsHaveEditRight = GetDataFromXMLHTTP("/SLXT/XSXC/XSXC_XMLHTTP.aspx", "IsHaveSpRight", "01010209", "02");
		        if (strIsHaveEditRight != 1) {
		            document.getElementById("btnOk").disabled = true;
		        }
		    }
		    function displaySum() {
		        document.getElementById("sumInfo").innerHTML = "查询到符合条件的客户有" + document.getElementById("appGrid_RowCount").innerText + "人，请选择对应的客户";
		    }
		    //双击记录时进入新增接电接访
		    function openFollowWin() {
		        var strUrl, strCstType, strFile, strRtn;
		        var arrTr = appGrid.frameElement.getSelected();
		        if (!arrTr) return;
                //如果是机会客户
		        if (Form1.txtType.value == "1") {
		            //根据资源化授权判断当前登录人员有无此机会的权限
		            strFile = "/Slxt/XSZDH/Khgl_Pub_XMLHTTP.aspx?OppGUID=" + escape(arrTr[0].OppGUID);
		            strRtn = openXMLHTTP(strFile, "CheckResRights");
		            if (strRtn == "FAIL") {
		                alert("您没有数据权限！");
		                return;
		            }
		            strUrl = "/Slxt/XSZDH/Jdjf_Edit.aspx?mode=2&CstGUID=" + escape(arrTr[0].oid) + "&ProjGUID=" + escape(arrTr[0].ProjGUID) + "&flag=1&CstType=" + escape(arrTr[0].CstType) + "&OppGUID=" + escape(arrTr[0].OppGUID);
		        }
		        else {
		            strUrl = "/Slxt/XSZDH/Jdjf_New.aspx?mode=2&oid=" + escape(arrTr[0].oid) + "&flag=1&ProjGUID=" + escape(parent.appQueryCtl0.value) + "&CstType=" + escape(arrTr[0].CstType) + "&from=new";
		        }
		        parent.isReFresh = 1;
		        parent.document.getElementById("div1").style.display = "none";
		        parent.document.getElementById("div2").style.display = "";
		        parent.document.getElementById("div3").style.display = "none";
		        parent.appIframe2.location = strUrl;
		    }
		    //上一步
		    function doUp() {
		        parent.document.getElementById("div1").style.display = "";
		        parent.document.getElementById("div2").style.display = "none";
		        parent.document.getElementById("div3").style.display = "none";
		        
		    }
		    //新建用户
		    function newUser() {
		        parent.isReFresh = 1;
		        var strUrl = "/Slxt/XSZDH/Jdjf_New.aspx?mode=1&CstType=" + escape(parent.Form1.txtCstType.value) + "&Tel=" + parent.Form1.txtPhone.value + "&ProjGUID=" + escape(parent.appQueryCtl0.value) + "&CstName=" + escape(parent.Form1.txtCstName.value) + "&from=new";
		        parent.document.getElementById("div1").style.display = "none";
		        parent.document.getElementById("div2").style.display = "";
		        parent.document.getElementById("div3").style.display = "none";
		        parent.appIframe2.location = strUrl;
		    }
		</script>
	</HEAD>
	<body style="padding:15px">
		<form id="Form1" runat="server">
		    <asp:textbox id="txtSumInfo" style="DISPLAY: none" runat="server" />
		    <asp:textbox id="txtType" style="DISPLAY: none" runat="server" />
		    <asp:textbox id="txtNewUserPower" style="DISPLAY: none" runat="server" />
	        <table style="FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
			    <tr height="23px"><td id="sumInfo" colspan="2"></td></tr>
			    <tr height="1">
				    <td colspan="2">
					    <mnu:AppGridMenu id="appGridMenu" runat="server" />
				    </td>
			    </tr>
			    <tr>
				    <td colspan="2">
					    <cnt:AppGrid id="appGrid" runat="server" MultiSelect="false" />
				    </td>
			    </tr>
			    <tr height="10px"><td></td></tr>
			    <tr height="23px">
			        <td  width="100%"><font color="red">1、如果查询的结果中没有需要登记的客户，请通过“新增客户”来增加客户；</font></td>
			        <td></td>
			    </tr>
			    <tr height="23px"> 
			        <td  width="100%"><font color="red">2、如果查询的结果中有需要登记的客户，请通过“选择客户并跟进”来跟进客户。</font></td>
			        <td align="right">
			            <button style="width:70px;" onclick="doUp()" id="btnUp" type="button">上一步</button>&nbsp;&nbsp; 
			            <button style="width:80px;" onclick="newUser()" id="btnNewUser" type="button">新增客户</button>&nbsp;&nbsp;
			            <button style="width:110px;" onclick="openFollowWin()" id="btnOk" type="button">选择客户并跟进</button>
			        </td>
			    </tr>
		    </table>
		</form>
	</body>
</HTML>
